﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;


namespace ruscehproj2
{
    public partial class MAIN : Form
    {

        splashScreen splash = new splashScreen();
        string hlpid = "1";
        bool hlpEnabled = false;
        
        
        public MAIN()
        {
            InitializeComponent();
           
        }

        public bool getHlpState()
        {
           
            return hlpEnabled;
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.BSH001.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
            
           // BSH001_1.ShowDialog(); // показываем
        }

        private void button2_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.BSH001.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            FormManager.BK006.ShowDialog();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            FormManager.BK006.ShowDialog();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.BSH002.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
            //BSH002.ShowDialog();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.BSH002.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void button8_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.BK007.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void button7_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.BK007.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void button9_Click(object sender, EventArgs e)
        {
            FormManager.BT006.ShowDialog();
        }

        private void button10_Click(object sender, EventArgs e)
        {
            FormManager.BK005.ShowDialog();
        }

        private void button12_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.shp1.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
            
        }

        private void bp119_Click(object sender, EventArgs e)
        {
            FormManager.bp1.enable(FormManager.shp1.getState());
            FormManager.bp1.ShowDialog();
        }

        private void br0032_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.br31.ShowDialog();
            /*
           if (FormManager.hlp.helpEnabled())
           {
               FormManager.hlp.hlpRefresh();
               FormManager.hlp.Show();
           }
           */
        }

        private void br0031_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.br31.ShowDialog();
           /*
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
            */
        }

        private void br0041_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.br41.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }

        }
        // презентация Кулиды
        private void br0042_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.br41.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bya001_Click(object sender, EventArgs e)
        {
            FormManager.bya1.ShowDialog();
        }

        private void bv001dal_Click(object sender, EventArgs e)
        {

            FormManager.hlp.Hide();
            FormManager.bv2dal.ShowDialog();//здесь должен быть блок дальности (картинка другая)
            if (FormManager.bv2dal.getState()) FormManager.hlp.setHelpId("5");
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
            

        }

        private void bv001az_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bv1.ShowDialog();
            
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }

        }

        private void bk008_Click(object sender, EventArgs e)
        {
            FormManager.bk8.ShowDialog();
        }

        private void bv010_Click(object sender, EventArgs e)
        {
            
            FormManager.bv10.ShowDialog();
        }

        private void bv0041_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bv41.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bv0042_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bv41.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void button13_Click(object sender, EventArgs e)
        {
            FormManager.IKO.ShowDialog();
        }

        private void Form1_HelpRequested(object sender, HelpEventArgs hlpevent)
        {
          

            if (!FormManager.hlp.helpEnabled())
            {
                 MessageBox.Show(" Помощь выключена!");
            }
                     

        }

        private void bv009kit1_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bv9kit1.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bv009kit2_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bv9kit1.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void br0071_Click(object sender, EventArgs e)
        {
            FormManager.br71.ShowDialog();
        }

        private void br0072_Click(object sender, EventArgs e)
        {
            FormManager.br71.ShowDialog();
        }

        private void bg0041_Click(object sender, EventArgs e)
        {
            FormManager.bg41.ShowDialog();
        }

        private void bg0011_Click(object sender, EventArgs e)
        {
            FormManager.bg11.ShowDialog();
        }

        private void bg0042_Click(object sender, EventArgs e)
        {
            FormManager.bg42.ShowDialog();
        }

        private void bg0012_Click(object sender, EventArgs e)
        {
            FormManager.bg12.ShowDialog();
        }

        private void bm0051_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bm51.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bm0052_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bm51.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bm0053_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bm51.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bm0054_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bm51.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bg0051_Click(object sender, EventArgs e)
        {
            FormManager.bg51.ShowDialog();
        }

        private void bg0052_Click(object sender, EventArgs e)
        {
            FormManager.bg52.ShowDialog();
        }

        private void bg0031_Click(object sender, EventArgs e)
        {
            FormManager.bg31.ShowDialog();

        }

        private void bg0032_Click(object sender, EventArgs e)
        {
            FormManager.bg32.ShowDialog();
        }

        private void bg0021_Click(object sender, EventArgs e)
        {
            FormManager.bg21.ShowDialog();
        }

        private void bg0022_Click(object sender, EventArgs e)
        {
            FormManager.bg22.ShowDialog();
        }

        private void bp1161_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bp61.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bp1162_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bp62.ShowDialog();
            if (FormManager.bp62.getState()) FormManager.hlp.setHelpId("13");
            if (FormManager.bp62.getState() && FormManager.bv9kit1.getState()) FormManager.hlp.setHelpId("18");
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void MAIN_Load(object sender, EventArgs e)
        {

            foreach (Control x in ruscehproj2.MAIN.ActiveForm.Controls)
            {
                if (x is Button)
                {
                    ((Button)x).FlatAppearance.BorderColor = Color.Black;
                    ((Button)x).FlatAppearance.BorderSize = 0;

                }
            }
        }


        private void button11_Click(object sender, EventArgs e)
        {
            FormManager.bv012.ShowDialog();
        }

        private void bp103_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bp13.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
                   }

        private void bsh003_1_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bsh03.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void bsh003_2_Click(object sender, EventArgs e)
        {
            FormManager.hlp.Hide();
            FormManager.bsh03.ShowDialog();
            if (FormManager.hlp.helpEnabled())
            {
                FormManager.hlp.hlpRefresh();
                FormManager.hlp.Show();
            }
        }

        private void MAIN_MouseHover(object sender, EventArgs e)
        {
           
        }

        private void MAIN_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            (sender as Form).Hide();
        }

            
    }
}